Repository navigation
Refactor to transform a list of special keys into keycapborder visuals - #163
Open
bfritscher wants to merge 1 commit into
Open
bfritscher wants to merge 1 commit into
bfritscher wants to merge 1 commit into
Conversation
doggy8088
added a commit
to doggy8088/carnac
that referenced
this pull request
Oct 9, 2026
) (#6) * Draw special keys as key caps from a single trigger Replace the 24 near-identical per-key DataTriggers in KeyShowView with one trigger driven by SpecialKeyConverter, backed by a unit-testable SpecialKeys name set in Carnac.Logic. The set is also extended to the keys that were still rendered as plain text (Caps Lock, Num Lock, Scroll Lock, Print Screen, Pause, the context-menu key and F13-F24). Based on the idea in Code52#163. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Pin key cap names, move converter next to its sibling, add tests Address review feedback: - ReplaceKey now names the aliased keys explicitly (CapsLock, ScrollLock, PrintScreen, PageUp) so the key cap labels read properly and do not depend on which alias Enum.ToString() returns on a given runtime. - SpecialKeyConverter moves to Utilities beside PlacementMarginConverter and declares its ValueConversion; the converter and the modifier names emitted by KeyProvider are now covered by tests. - Restore the blank line and indentation around the Win trigger. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Address second review round: CI compile fix, more key caps, labels - Drop the converter test that referenced Binding.DoNothing (needs System.Xaml in the CI/legacy build) and the KeyProvider-based test that depended on the foreground window. - Pin Return/Enter like the other aliased keys, label the context-menu key "Menu", and add Space (in shortcuts, e.g. Ctrl+Space), Cancel and Clear. - Document why ReplaceKey names these keys explicitly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Label the context-menu key and Ctrl+Break, cover Shift+Space - "Menu" is the Alt key's Keys member (VK_MENU), so ReplaceKey.ToKey("Menu") would not resolve to the context-menu key: label it "ContextMenu". - Ctrl+Break is Keys.Cancel; show it as "Break", the label on the key. - Treat any multi-part input as a shortcut when formatting, so Shift+Space draws a Space key cap like Ctrl+Space does. - Note in the XAML and in SpecialKeys that Return and Win have their own triggers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Keep Shift+Space as it was, guard the Return/Win invariant Treating every multi-part input as a shortcut also turned the space typed with Shift held ("HELLO WORLD") into a Shift + Space key cap in the middle of a sentence. Revert that: Space is a key cap in Ctrl/Alt/Win shortcuts only. Also explain in ReplaceKey that the table is read by ToKey too, test that the Break label resolves to Ctrl+Break for the keymaps, and pin that Return and Win stay out of SpecialKeys because they have their own triggers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Tidy the key cap set and its tests after review - Clear is no longer a key cap: with NumLock off it is what the 5 on the numpad types, and a "Clear" cap in the middle of a number is a surprise. - The keymap test now covers only the names that resolve through the table (the names that are members of Keys parse with Enum.TryParse whatever the table says), and the duplicate Break assertion is gone. - The closing tag of the triggers lines up with the opening one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Restore the tests for what is not a key cap They were removed by mistake together with a duplicate assertion: text that has to stay plain (wrong case, F0/F25, Clear, separators, arrows) and a typed space. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: merge check <merge-check@example.invalid>
|
Hi there! 👋 I (@doggy8088 / Will Huang) have stepped in to take over active maintenance of Carnac at doggy8088/carnac (project website: https://carnac.gh.miniasp.com/). Thank you @bfritscher for contributing this refactoring PR to transform special keys into keycap border visuals! 🎉 Context & What Changed
Availability
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.